Skip to contentSkip to conversation

iOS key decrypts

Openvpn-devel Gregory Sloop 4 participants 5 messages Jul 18, 2017 – Jul 20, 2017

lore
Share & tools
lore
#0 lore raw

So, I'm not sure if this [the dev list] is the place to post this - though I suspect the well of knowledge here vs the regular list will be more appropriate to answer.

It's been a long time since I needed to roll out openvpn to an iOS device and the last time I did it, I did it via separate PKCS12 and config files. [IIRC, PKCS12 is 3DES encrypted - not very secure.]

The last time, I also had a modestly secure way of getting the PKCS12 files to the clients. But in iOS, unified confg files can't be pulled from a website - essentially you either email the config, or transfer it via itunes.

So, I'm trying to do a unified config file with the ca, certs and keys embedded. However, it appears that current versions of iOS can't handle AES-256 encrypted keys. [At least that's my best guess from the errors I get - using my weak google-foo etc. "OpenVPN error polarssl error parsing config private key : PK - Bad input parameters to function."]

So all that dross above to ask:
Does anyone know definitively what key encryptions/decryptions the iOS client will properly handle? [And if there's any difference using unfied vs non-unified setups.]

TIA

-Greg

#1 lore raw

Hi,

Quoted 2 lines · Gregory Sloop

But in iOS, unified confg files can't be pulled from a website - essentially you either email the config, or transfer it via itunes.

Downloading from a website works just fine. You need to coax Apache to set a few headers, but then, all good :-)

This is what I have in my apache conf:

<FilesMatch "\.ovpn$">
SetEnvIf Request_URI "^.*/([^/]*)$" FILENAME=$1
Header set "Content-Disposition" "attachment; filename=\"%{FILENAME}e\"" UnsetEnv FILENAME
</FilesMatch>

(it looks slightly convoluted, but I found no other way to specify the filename, and that's needed)

In addition, mime.types has

application/x-openvpn-profile ovpn

no idea about the encrypted keys in iOS, though.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw
In reply to Gregory Sloop

Hi,

Quoted 3 lines · Gregory Sloop

Does anyone know definitively what key encryptions/decryptions the iOS client will properly handle? [And if there's any difference using unfied vs non-unified setups.]

The iOS client is not part of the current community development, but maintained by OpenVPN Technologies. You could try to get in touch with them.

That said, I see no reason why it could not support AES-encrypted keys. The 2.x community code base even uses AES-encrypted test keys (PEM, not PKCS12), and those work with both OpenSSL and mbed TLS crypto backends (just tested as for back as PolarSSL 1.2, but earlier versions probably too).

-Steffan

#3 lore raw
Quoted 11 lines · Steffan Karger

Hi,

Quoted 4 lines · Gregory Sloop

Does anyone know definitively what key encryptions/decryptions the iOS client will properly handle? [And if there's any difference using unfied vs non-unified setups.]

The iOS client is not part of the current community development, but maintained by OpenVPN Technologies.  You could try to get in touch with them.

Quoted 5 lines

That said, I see no reason why it could not support AES-encrypted keys. The 2.x community code base even uses AES-encrypted test keys (PEM, not PKCS12), and those work with both OpenSSL and mbed TLS crypto backends (just tested as for back as PolarSSL 1.2, but earlier versions probably too).

There's a bunch of certs/keys you could test with in
http://git.infradead.org/users/dwmw2/openconnect.git/tree/HEAD:/tests/certs

#4 lore raw
In reply to Steffan Karger

SK> Hi,

Quoted 3 lines · Gregory Sloop
Quoted 3 lines

Does anyone know definitively what key encryptions/decryptions the iOS client will properly handle? [And if there's any difference using unfied vs non-unified setups.]

SK> The iOS client is not part of the current community development, but SK> maintained by OpenVPN Technologies. You could try to get in touch with SK> them.

SK> That said, I see no reason why it could not support AES-encrypted keys. SK> The 2.x community code base even uses AES-encrypted test keys (PEM, not SK> PKCS12), and those work with both OpenSSL and mbed TLS crypto backends SK> (just tested as for back as PolarSSL 1.2, but earlier versions probably SK> too).

SK> -Steffan

Thanks.

Yeah, these same unified configs with the AES-256 encrypted keys work just fine on the Windows and OSX versions of OpenVPN/TunnelBlick. Thus I expected them to work without issue on iOS. [Exact same config installed fine on OSX for the same client.]

My problem at the moment is I don't have an iOS device where I can easily test, and this client is more than an hour away from me physically - so "testing" isn't very easy. [They're a very non-tech savvy client.]

So, I hate to try to "test" on this client - by sending several different unified configs with different key encryptions, hoping to luck onto the right combination.

---
Perhaps another line of thought.
The unified config I sent looks like this
---
client
dev tun
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-256-cbc
auth sha256
remote-cert-tls server
verb 3
remote 1.2.3.4 1194

<cert>
</cert>

<key>
</key>

<ca>
</ca>

---
Most examples have the order different - ca - cert - key.
Could this have any impact? [Seems totally NUTS if it does - but I'm grasping at straws a bit....

[I like them in this order because the ca doesn't change for each client-machine, but obviously the cert/key do - and having them at the top is just a bit easier.]

I'll see if I can dig up an iOS device to test with, but if anyone really wants to kill some time and check it for me - I'd be eternally grateful. :)

-Greg

---